<script setup lang="ts">
  import {inject,reactive} from 'vue'
  import {Toast} from 'vant'
  import {updateAdvantage} from '@/api/resume'
  const {closeChange} = inject('popup') as any
  const props = defineProps({
    advantageInfo: {
      type: String
    }
  })
  const submit = async () => {
    if(!props.advantageInfo){
        Toast('请输入个人优势')
        return
    }
    updateAdvantage(props.advantageInfo).then(res => {
      Toast(res.msg)
    })
  }
</script>
<template>
    <van-nav-bar title="个人优势" left-arrow @click-left="closeChange"/>
    <van-field
        v-model="advantageInfo"
        rows="12"
        autosize
        label=""
        type="textarea"
        maxlength="500"
        placeholder="请输入您的个人优势"
        show-word-limit
    />
    <button class="wy-submit" @click="submit">保存</button>
</template>